import path from "path";
import { defineConfig } from "vite";
import { createVuePlugin } from "vite-plugin-vue2";
// import dtsPlugin from "vite-plugin-dts"

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [createVuePlugin()],
  server: {
    port: 3200,
  },
  build: {
    assetsInlineLimit: 0,
    lib: {
      entry: path.resolve(__dirname, "src/packages/videoPlayer/index.ts"),
      name: "UniVideoPlayer",
      fileName: (format) => `uniVideoPlayer.${format}.js`,
    },
    rollupOptions: {
      external: ["vue", "axios"],
      output: {
        globals: {
          vue: "Vue",
          axios: "axios",
        },
      },
    },
  },
});
